package com.itheima.edu.day19File;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class IOTest {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String useName = sc.next();
        System.out.println("请输入密码：");
        String passWord = sc.next();

        FileWriter fw = new FileWriter("itheima-edu-info-manager\\a.txt");
        fw.write("用户名：" + useName);
        fw.write("\r\n");
        fw.write("密码：：" + passWord);
        fw.close();

        FileReader fr = new FileReader("itheima-edu-info-manager\\a.txt");
        int ch;
        while ((ch = fr.read()) != -1) {
            System.out.print((char)ch);
        }
        fr.close();
    }
}
